<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>slot-具名插槽的使用</title>
</head>

<body>
    <div id="app">
        <!-- 没有指定插槽时，替换没有name的插槽 -->
        <cpn><button>按钮</button></cpn>
        <!-- 替换指定插槽 -->
        <cpn><button slot="left">替换left</button></cpn>
        <cpn><button slot="center">替换center</button></cpn>
        <cpn><button slot="right">替换right</button></cpn>
    </div>
    <template id="cpn">
        <div>
            <slot name="left">left</slot>
            <slot name="center">center</slot>
            <slot name="right">right</slot>
            <slot>123</slot>
        </div>
    </template>
    <script src="./js/vue.min.js"></script>
    <script>
        const app = new Vue({
            el: '#app',
            data: {
                message: 'hello'
            },
            components: {
                cpn: {
                    template: '#cpn',
                    data() {
                        return {

                        }
                    },
                    props: {

                    }

                }
            }
        })
    </script>
</body>

</html>